package sourceCode;

import java.awt.geom.Point2D;

import java.util.ArrayList;

public abstract class ConteneurChariots extends Noeud {

    ArrayList<Chariot> listChariots;

    ConteneurChariots(int _id, Point2D.Double _point) {
        super(_id, _point);
        listChariots = new ArrayList<Chariot>();
    }

    public Boolean ajouterChariot(Chariot c) {
        this.chariotContenu = c;
        c.setNoeud(this);
        return this.listChariots.add(c);
    }

    public void ajouterChariotXML(Chariot c) {
        c.setNoeud(this);
    }


    public Boolean supprimerChariot(Chariot c) {
        this.chariotContenu = null;
        c.setNoeud(null);
        return this.listChariots.remove(c);
    }

    public void setListChariots(ArrayList<Chariot> listChariots) {
        this.listChariots = listChariots;
    }

    public ArrayList<Chariot> getListChariots() {
        return listChariots;
    }
}
